package com.bolt.support.sqlconfig.dialect;

/**
 * Created by Administrator on 2017/8/16.
 */
public class PagingMySQLDialect extends PagingDialect {

    @Override
    public String getLimitString(String sql, long offset, long limit) {
        StringBuilder stringBuilder = new StringBuilder(sql);
        stringBuilder.append(" limit ");
        if(offset > 0){
            stringBuilder.append(Long.toString(offset)).append(",").append(Long.toString(limit));
        }else{
            stringBuilder.append(Long.toString(limit));
        }
        return stringBuilder.toString();
    }
}
